<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head th:include="include/css-head :: css-head">
</head>
<body>
<section class="content-header">
  <h1>
    <small></small>
  </h1>
  <ol class="breadcrumb">
    <li><a href="#"><i class="fa fa-dashboard"></i>试题管理</a></li>
    <li class="active">试题信息</li>
  </ol>
</section>

<!-- Main content -->
<section class="content">
	 <div class="box">
            <div class="box-header">
              <h3 class="box-title">试题管理</h3>
              <br><br>
              	<button class="btn btn-success btn-sm" id="addData"><i class="fa fa-plus"></i> &nbsp;&nbsp;添加试题</button>
				<div class="btn-right">
					<label class="form-inline">试题名称：<input type="text" class="form-control" id="qname" th:value="${name}"  autocomplete="off" /></label>
					<button class="btn btn-primary btn-sm" id="btn_search">查询</button>
				</div>
				<div class="clear"></div>
			</div>
            <div class="box-body">
              <table id="dataList" class="table table-bordered table-striped">
                <thead>
	                <tr>
	                    <th width="50px;">序号</th>
						<th width="100px;">试题分类</th>
						<th width="250px;">试题名称</th>
						<th>选项A</th>
						<th>选项B</th>
						<th>选项C</th>
						<th>选项D</th>
						<th  width="100px;">答案</th>
						<th  width="250px;">操作</th>
	                </tr>
                </thead>
                <tbody>
				<tr th:each="one,stat:${result.data.list}">
					<td th:text="${stat.count}">序号</td>
					<td th:text="${one.type}">试题分类</td>
					<td th:text="${one.questionname}">试题名称</td>
					<td th:text="${one.optionA}">选项A</td>
					<td th:text="${one.optionB}">选项B</td>
					<td th:text="${one.optionC}">选项C</td>
					<td th:text="${one.optionD}">选项D</td>
					<td th:text="${one.answer}">答案</td>
					<td >
						<span data-toggle="tooltip" data-placement="left" title="查看" class="btn btn-xs btn-success" th:onclick="'detailQuestion('+${one.id}+')'"><i class="fa fa-eye"></i>查看</span>
						<span data-toggle="tooltip" data-placement="left" title="修改" class="btn btn-xs btn-info" th:onclick="'editQuestion('+${one.id}+')'"><i class="fa fa-edit"></i> 修改</span>
						<span data-toggle="tooltip" data-placement="right" title="删除" class="btn btn-xs btn-danger" th:onclick="'delQuestion('+${one.id}+')'"><i class="fa fa-trash-o"></i>删除</span>
					</td>
				</tr>
				<tr>
					<td height="30" colspan="10">
						<!--分页-->
						<div class="footer_style1">
							<span>共有<strong th:text="${result.data.recordsTotal}"></strong>条记录，当前第<strong><th:block th:text="${result.data.draw}"></th:block>/<th:block th:text="${result.data.totalpage}"></th:block></strong>页</span>
							<ul class="ul_style3">
								<li th:if="${result.data.draw eq 1}">
									<a>首页</a>
									<a>上一页</a>
								</li>
								<li th:if="${result.data.draw ne 1}">
									<a th:href="@{/question/list(pageNo=1)}">首页</a>
									<a th:href="@{/question/list(pageNo=${result.data.draw - 1})}">上一页</a>
								</li>
								<li th:if="${result.data.draw eq result.data.totalpage}">
									<a>下一页</a>
									<a>尾页</a>
								</li>
								<li th:if="${result.data.draw ne result.data.totalpage}">
									<a th:href="@{/question/list(pageNo=${result.data.draw + 1})}">下一页</a>
									<a th:href="@{/question/list(pageNo=${result.data.totalpage})}">尾页</a>
								</li>
							</ul>
						</div>

						<!--分页 end-->
					</td>
				</tr>
                </tbody>
                </table>
			</div>
	 </div>
	 </div>
</section>

<div class="modal fade" id="questionModal" tabindex="-1" role="dialog"
	 aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
				<h4 class="modal-title text-center" id="questionmodelHead">添加试题</h4>
			</div>
			<div class="modal-body">
				<form class="form-horizontal"  role="form" id="myform">
					<input type="hidden" name="id" value=""/>
					<input type="hidden" name="url" value=""/>
					<div class="form-group">
						<label for="questionname" class="col-sm-2 control-label">试题名称</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" name="questionname" value="" id="questionname">
						</div>
					</div>
					<div class="form-group">
						<label for="type" class="col-sm-2 control-label">试题类型</label>
						<div class="col-sm-10">
							<select name="type" class="form-control" id="type" data-actions-box="true">
								<option value="单选题">单选题</option>
								<option value="多选题">多选题</option>
							</select>
						</div>
					</div>
					<div class="form-group">
						<label for="optionA" class="col-sm-2 control-label">选项A</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" name="optionA" value="" id="optionA" placeholder="请输入选项A">
						</div>
					</div>
					<div class="form-group">
						<label for="optionB" class="col-sm-2 control-label">选项B</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" name="optionB" value="" id="optionB" placeholder="请输入选项B">
						</div>
					</div>
					<div class="form-group">
						<label for="optionC" class="col-sm-2 control-label">选项C</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" name="optionC" value="" id="optionC" placeholder="请输入选项C">
						</div>
					</div>
					<div class="form-group">
						<label for="optionD" class="col-sm-2 control-label">选项D</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" name="optionD" value="" id="optionD" placeholder="请输入选项D">
						</div>
					</div>
					<div class="form-group">
						<label for="optionE" class="col-sm-2 control-label">选项E</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" name="optionE" value="" id="optionE" placeholder="请输入选项E">
						</div>
					</div>
					<div class="form-group">
						<label for="optionF" class="col-sm-2 control-label">选项F</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" name="optionF" value="" id="optionF" placeholder="请输入选项F">
						</div>
					</div>
					<div class="form-group">
						<label for="optionG" class="col-sm-2 control-label">选项G</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" name="optionG" value="" id="optionG" placeholder="请输入选项G">
						</div>
					</div>
					<div class="form-group">
						<label for="optionH" class="col-sm-2 control-label">选项H</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" name="optionH" value="" id="optionH" placeholder="请输入选项H">
						</div>
					</div>
					<div class="form-group">
						<label  class="col-sm-2 control-label">正确答案</label>
						<div class="col-sm-10" style="padding-top:7px;">
							<input name="answer" type="checkbox" class="form-check-input " value="A"/>A
							<input name="answer" type="checkbox" class="form-check-input " value="B"/>B
							<input name="answer" type="checkbox" class="form-check-input " value="C"/>C
							<input name="answer" type="checkbox" class="form-check-input " value="D"/>D
							<input name="answer" type="checkbox" class="form-check-input " value="E"/>E
							<input name="answer" type="checkbox" class="form-check-input " value="F"/>F
							<input name="answer" type="checkbox" class="form-check-input " value="G"/>G
							<input name="answer" type="checkbox" class="form-check-input " value="H"/>H
						</div>
					</div>

				</form>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-primary" data-dismiss="modal">关闭</button>
				<button type="submit" class="btn btn-success"  id="imgSubmit" >确定</button>
			</div>
		</div>
	</div>
</div>
<script src="/static/bower_components/jquery/dist/jquery.min.js"></script>
<script src="/static/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="/static/bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
<script src="/static/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
<script src="/static/dist/js/adminlte.min.js"></script>
<script src="/static/js/path.js"></script>
<script src="/static/js/question.js"></script>
</body>
</html>
